<?php
/**
 * Created by PhpStorm.
 * User: wodrow
 * Date: 2018/9/17
 * Time: 14:49
 */

namespace admin\modules\docu\models;


use dosamigos\taggable\Taggable;
use yii\helpers\ArrayHelper;

class Docu extends \common\models\db\Docu
{
    public function behaviors()
    {
        $p = parent::behaviors();
        $s = [
            'taggable' => [
                'class' => Taggable::class,
            ],
        ];
        $new = ArrayHelper::merge($p, $s);
        return $new;
    }

    public function attributeLabels()
    {
        $p = parent::attributeLabels();
        $als = [
            'tagNames' => "标签",
        ];
        $als = ArrayHelper::merge($p, $als);
        return $als;
    }

    public function rules()
    {
        $p_rules = parent::rules();
        $rules = [
            ['tagNames', 'safe'],
        ];
        $rules = ArrayHelper::merge($p_rules, $rules);
        return $rules;
    }
}